package com.sean.action;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.sean.form.UserAddFrom;
import com.sean.velocity.TimeHelper;

@Controller
public class VelocityViewController {
	private Logger logger = Logger.getLogger(UserController.class);

	@RequestMapping("/vm/welcome.do")
	public ModelAndView gotoView(final UserAddFrom form,
			HttpServletRequest resq, HttpServletResponse resp) {

		if (logger.isDebugEnabled()) {
			logger.debug(form);
		}
		Map model = new HashMap();
		model.put("formater", new TimeHelper());
		model.put("session", resq.getSession());
		return new ModelAndView("welcome", model);
	}

}
